package com.green.service.manage.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.green.common.page.Pagination;
import com.green.dao.manage.OperateLogDao;
import com.green.model.manage.OperateLog;
import com.green.model.manage.enums.OperateLogTypeEnum;
import com.green.service.common.ServiceContext;
import com.green.service.common.impl.BaseServiceImpl;
import com.green.service.manage.OperateLogService;



/**
 * 操作日志
 * 
 */
@Repository("operateLogService")
public class OperateLogServiceImpl extends BaseServiceImpl implements OperateLogService {
	@Autowired
	private OperateLogDao operateLogDao;
	@Override
	public int insertOperateLog(OperateLog ct) {
		return operateLogDao.insertOperateLog(ct);
	}

	@Override
	public int updateOperateLog(OperateLog ct) {
		return operateLogDao.updateOperateLog(ct);
	}

	@Override
	public int deleteOperateLog(Map<String, Object> param) {
		return operateLogDao.deleteOperateLog(param);
	}

	@Override
	public OperateLog getOperateLogById(String id) {
		return operateLogDao.getOperateLogById(id);
	}

	@Override
	public List<OperateLog> getOperateLogList(Map<String, Object> param) {
		return operateLogDao.getOperateLogList(param);
	}

	@Override
	public Pagination<OperateLog> getOperateLogPagination(
			Pagination<OperateLog> pag, Map<String, Object> param) {
		return operateLogDao.getOperateLogPagination(pag, param);
	}
	
	@Override
	public void insertQfangIntefaceOperateLog(String content){
    	OperateLog operateLog = new OperateLog();
		operateLog.setUUID();
		operateLog.setOperateLogType(OperateLogTypeEnum.QFANGINTEFACE);
		operateLog.setCreateBy(ServiceContext.getLoginPerson());
		operateLog.setContent(content);
		operateLog.setPersonName(ServiceContext.getLoginPerson().getName());
		operateLog.setIp(ServiceContext.getRequestIP());
    	operateLogDao.insertOperateLog(operateLog);
    }
	
}
